<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        function getnum() {
            let arr = []
            let num = 0
            for (let i = 0; i < 3; i++) {
                let num1 = +prompt(`请输入第${i + 1}个数`)
                arr.push(num1)
                num += num1
            }
            let cha = arr[0], ji = arr[0], chu = arr[0]
            for (let i = 1; i < arr.length; i++) {
                cha = cha -= arr[i]
                ji = ji *= arr[i]
                chu = chu /= arr[i]
            }
            return [num, cha, ji, chu]
        }
        let arr1 = getnum()
        // console.log(arr1)
        document.write(`和，差，积，商依次是：<br>`)
        for (let i = 0; i < arr1.length; i++) {
            document.write(`${arr1[i]}<br>`)
        }
    </script>
</body>

</html>